<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>DeBian | VanKa</title><script src="https://cdn.bootcss.com/valine/1.4.4/Valine.min.js"></script><link rel="stylesheet" href="/vcb/css/arknights.css"><link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/highlight.js/10.1.2/styles/atom-one-dark-reasonable.min.css"><style>@font-face {
 font-family: BenderLight;
 src: local('Bender'), url("/vcb/font/BenderLight.ttf");
}
@font-face {
 font-family: 'JetBrains Mono';
 src: local('JetBrains Mono'), url('/vcb/font/JetBrainsMono-Regular.woff2') format('woff2');
}</style><meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/vcb/atom.xml" title="VanKa" type="application/atom+xml">
</head><body><header><nav><a href="/vcb/">Home</a><a href="/vcb/archives/">Archives</a></nav></header><main><article><div id="post-bg"><div id="post-title"><h1>DeBian</h1><hr></div><div id="post-content"><h4 id="启用填坑"><a href="#启用填坑" class="headerlink" title="启用填坑"></a>启用填坑</h4><h5 id="root用户无法ssh连接服务器"><a href="#root用户无法ssh连接服务器" class="headerlink" title="root用户无法ssh连接服务器"></a>root用户无法ssh连接服务器</h5><table>
<thead>
<tr>
<th>账户</th>
<th>密码</th>
</tr>
</thead>
<tbody><tr>
<td>pi</td>
<td>raspberry</td>
</tr>
<tr>
<td>root</td>
<td>ry112233</td>
</tr>
</tbody></table>
<p>默认账户pi账户支持ssh登录</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo passwd root   # 设置root账户密码</span><br><span class="line">sudo -i            # 切换到root用户</span><br></pre></td></tr></table></figure>

<ol>
<li><p>以root用户登录，需要以用户pi登录，修改root密码，并开启root的ssh远程登录权限</p>
</li>
<li><p>解锁root用户</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo passwd -u root  # 淘汰，没用</span><br></pre></td></tr></table></figure>

<p>修改ssh的配置文件</p>
<p>/etc/ssh/sshd_config 将配置项PermitRootLoginwithout-password修改为PermitRootLogin yes，重启系统之后就可以登录</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get update           <span class="comment"># 更新</span></span><br><span class="line">sudo apt-get install -y vim   <span class="comment"># 更新vim</span></span><br><span class="line">sudo vi/etc/ssh/sshd_config  <span class="comment"># 修改文件</span></span><br><span class="line">sudo reboot                   <span class="comment"># 重启系统 [!!!危险!!!]</span></span><br></pre></td></tr></table></figure>

 <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">/etc/init.d/ssh restart      <span class="comment"># 重启ssh服务</span></span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">service sshd restart		<span class="comment"># 重启ssh服务，即可</span></span><br></pre></td></tr></table></figure></li>
</ol>
<h5 id="网卡配置"><a href="#网卡配置" class="headerlink" title="网卡配置"></a>网卡配置</h5><blockquote>
<p>由于Debian与CentOS不一样，所以配置文件也不一样</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://github.com/alibaba/nacos/releases/download/2.0.3/nacos-server-2.0.3.tar.gz">https://github.com/alibaba/nacos/releases/download/2.0.3/nacos-server-2.0.3.tar.gz</a></p>
<table>
<thead>
<tr>
<th>服务</th>
<th>DeBian</th>
</tr>
</thead>
<tbody><tr>
<td>网卡配置文件</td>
<td>/etc/network/interfaces</td>
</tr>
<tr>
<td>NDS配置文件</td>
<td>/etc/resolv.conf</td>
</tr>
<tr>
<td>软件源配置文件</td>
<td>/etc/apt/sources.list</td>
</tr>
</tbody></table>
<p>网卡配置文件</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">auto lo												# 开机启动loopback网卡</span><br><span class="line">auto eth0											# 开机自动连接网络</span><br><span class="line"></span><br><span class="line">iface lo inet loopback 								# 网卡名称是lo, 类型是loopback</span><br><span class="line">allow-hotplug eth0									# 网卡热插拔模式</span><br><span class="line">iface eth0 inet static								# static表示使用固定ip，dhcp表述使用动态ip</span><br><span class="line">address 192.168.0.19								# 表示设置ip地址</span><br><span class="line">netmask 255.255.255.0								# 表示子网掩码</span><br><span class="line">gateway 192.168.0.30								# 表示网关</span><br><span class="line">nameserver 114.114.114.114							# 设置首选dns</span><br><span class="line">nameserver 8.8.8.8									# 设置备用dns</span><br><span class="line"></span><br><span class="line"># The primary network interface</span><br><span class="line">auto ens33 #网卡随系统启动而启动，推荐这种模式</span><br><span class="line">iface ens33 inet static   #static为静态模式</span><br><span class="line">        address 172.16.1.8   #ip地址</span><br><span class="line">        netmask 255.255.255.0  #掩码</span><br><span class="line">        gateway 172.16.1.254  #网关</span><br></pre></td></tr></table></figure>

<p>NDS配置文件</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">nameserver 8.8.8.8</span><br><span class="line">nameserver 114.114.114.114</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">/etc/init.d/networking restart						# 命令使用网卡配置文件内容生效</span><br><span class="line">service networking restar 							# 重启网络</span><br></pre></td></tr></table></figure>

<p>报错：</p>
<blockquote>
<p>networking.serviceJob for networking.service failed because the control process exited with error code.</p>
</blockquote>
<blockquote>
<p>sudo /etc/init.d/networking restart<br>[….] Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code.<br>See “systemctl status networking.service” and “journalctl -xe” for details.<br> failed!</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://www.debian.org/doc/manuals/debian-reference/">DeBian参考手册</a></p>
<h4 id="便签"><a href="#便签" class="headerlink" title="便签"></a>便签</h4><p>在树莓派上安装 Docker<br>在 Raspbian 上安装 Docker 很容易，请参阅Raspberry Pi 上的 Docker 入门以获取更多信息。</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">curl -sSL https://get.docker.com | sh</span><br></pre></td></tr></table></figure>
<p>创建基于 Debian 的 MySQL 5.7 Docker 镜像<br>有 MySQL 5.7 Docker 映像，但它们与 Raspberry Pi 不兼容，因为 Raspbian 使用arm32v7/armel架构。</p>
<p>然而，现有的 MySQL 5.7 Docker 镜像可以用作参考。我使用Oracle的官方 MySQL 5.7 Docker 镜像作为模板。</p>
<p>我的研究表明，目前只有 Debian Sid在其数据库中提供MySQL 5.7。</p>
<p>注意：Debian Sid 是 Debian 的开发版本。Debian Sid 不稳定，也不受官方支持。安全性得不到保障。使用此类图像时请慎重考虑。</p>
<p>我创建了以下Dockerfile.</p>
<p>docker运行mysql ibex/debian-mysql-server-5.7</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">docker run --name mysql57 \</span><br><span class="line">           -d \</span><br><span class="line">           --restart unless-stopped \</span><br><span class="line">           -p 127.0.0.1:3306:3306 \</span><br><span class="line">           -p 127.0.0.1:33060:33060 \</span><br><span class="line">           -v /path/to/mysql57/data:/var/lib/mysql \</span><br><span class="line">           -v /path/to/mysql57/my.cnf:/etc/mysql/conf.d/my.cnf \</span><br><span class="line">           -e MYSQL_ALLOW_EMPTY_PASSWORD=yes \</span><br><span class="line">           debian-mysql-server-5.7</span><br></pre></td></tr></table></figure>
<p>直接运行</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker run -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -v /home/work/mysql/conf:/etx/mysql -v /home/work/mysql/data:/var/lib/mysql --name mysql-nacos -d mysql/mysql-server</span><br></pre></td></tr></table></figure>
<p>创建好指定的目录</p>
<p>MYSQL8是上面启动的时候 为该容器起的名称</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker exec -it mysql11 /bin/bash</span><br></pre></td></tr></table></figure>
<p>进入mysql</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mysql -uroot -p123456</span><br></pre></td></tr></table></figure>
<p>查看版本</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">select version()</span><br><span class="line">+-----------+</span><br><span class="line">| version() |</span><br><span class="line">+-----------+</span><br><span class="line">| 8.0.26    |</span><br><span class="line">+-----------+</span><br><span class="line"></span><br></pre></td></tr></table></figure>


<h5 id="安装宝塔"><a href="#安装宝塔" class="headerlink" title="安装宝塔"></a>安装宝塔</h5><p>Debian版安装命令：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh &amp;&amp; bash install.sh</span><br></pre></td></tr></table></figure>

<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh &amp;&amp; bash install.sh</span><br></pre></td></tr></table></figure>

<h5 id="mysql"><a href="#mysql" class="headerlink" title="mysql"></a>mysql</h5><blockquote>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apt-get install mysql-server mysql-client</span><br></pre></td></tr></table></figure>
</blockquote>
<p>安装</p>
<ol>
<li><p>下载</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">wget https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb</span><br></pre></td></tr></table></figure></li>
<li><p>安装</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo dpkg -i mysql-apt-config*</span><br></pre></td></tr></table></figure></li>
</ol>
<h5 id="Nginx"><a href="#Nginx" class="headerlink" title="Nginx"></a><a target="_blank" rel="noopener" href="https://blog.csdn.net/cukw6666/article/details/107983496">Nginx</a></h5><ol>
<li><p>安装环境(应该可以省略)</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get install libpcre3 libpcre3-dev openssl libssl-dev libperl-dev</span><br></pre></td></tr></table></figure></li>
<li><p>安装nginx</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install nginx</span><br></pre></td></tr></table></figure></li>
<li><p>测试是否成功</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">curl localhost</span><br></pre></td></tr></table></figure></li>
<li><p>启动/关闭</p>
</li>
</ol>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo systemctl stop nginx</span><br><span class="line">sudo systemctl停止nginx</span><br></pre></td></tr></table></figure>

<p>现在您已启动并运行了Web服务器，让我们回顾一些基本的管理命令。</p>
<p>To stop your web server, type:</p>
<p>要停止您的Web服务器，请输入：</p>
<ul>
<li><p>sudo systemctl stop nginx</p>
<p>sudo systemctl停止nginx</p>
</li>
</ul>
<p>To start the web server when it is stopped, type:</p>
<p>要在停止时启动Web服务器，请键入：</p>
<ul>
<li><p>sudo systemctl start nginx</p>
<p>sudo systemctl启动nginx</p>
</li>
</ul>
<p>To stop and then start the service again, type:</p>
<p>要停止然后再次启动该服务，请键入：</p>
<ul>
<li><p>sudo systemctl restart nginx</p>
<p>sudo systemctl重启nginx</p>
</li>
</ul>
<p>docker run -it -d –name=centos-tb \  -p 8888:8888 \   centos</p>
<p>yum install -y wget &amp;&amp; wget -O install.sh <a target="_blank" rel="noopener" href="http://103.224.251.67:5880/install/install-ubuntu_6.0.sh">http://103.224.251.67:5880/install/install-ubuntu_6.0.sh</a> &amp;&amp; bash install.sh</p>
<blockquote>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">2019-08-18 17:00:50-- http://download.bt.cn/install/install_6.0.sh</span><br><span class="line">Resolving download. bt. cn (download.bt.cn)... failed: Name or service not known.</span><br><span class="line">wget: unable to resolve host address ‘download.bt.cn’</span><br></pre></td></tr></table></figure>
</blockquote>
<p>故障原因：<br>服务器无法解析download.bt.cn这个域名。</p>
<p>解决方法：<br>在服务器SSH运行以下代码，改写本地hosts。能正常安装的不要改！！！<br>保不齐哪天宝塔又换服务器IP。</p>
<p>国内的在服务器上执行这条命令：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">echo &#x27;125.88.182.172  download.bt.cn&#x27; &gt;&gt;/etc/hosts</span><br></pre></td></tr></table></figure>

<p>香港的执行这条命令：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">echo &#x27;103.224.251.67  download.bt.cn&#x27; &gt;&gt;/etc/hosts</span><br></pre></td></tr></table></figure>

<p>美国或者国外的执行这条命令：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">echo &#x27;128.1.164.196 download.bt.cn&#x27; &gt;&gt;/etc/hosts</span><br></pre></td></tr></table></figure>

<p>附第二种方法：改DNS为114.114.114.114</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">vi /etc/resolv.conf</span><br><span class="line">nameserver 114.114.114.114   # 国内服务器</span><br><span class="line">nameserver  8.8.8.8          # 国外服务器</span><br></pre></td></tr></table></figure>

<h4 id="其他"><a href="#其他" class="headerlink" title="其他"></a>其他</h4><ul>
<li><a target="_blank" rel="noopener" href="https://yaoo.xin/index.php/archives/17/">Docker 容器内安装宝塔</a></li>
</ul>
<div id="paginator"></div></div><div id="post-footer"><hr><a href="/vcb/2021/09/13/Linux/">← Prev Linux</a><span style="color: #fe2"> | </span><a href="/vcb/2021/08/30/Docker/">Docker Next →</a><hr></div><div id="bottom-btn"><a id="to-index" href="#post-index" title="index">≡</a><a id="to-top" href="#post-title" title="to top">∧</a></div><div id="Valine"></div><script>new Valine({
 el: '#Valine'
 , appId: ''
 , appKey: ''
 , placeholder: '此条评论委托企鹅物流发送'
})</script></div></article><aside><div id="about"><a href="/vcb/" id="logo"><img src="https://ak.hypergryph.com/assets/index/images/ak/pc/faction/1.png" alt="Logo"></a><h1 id="Dr"><a href="/"> Dr.VanKa</a></h1><section id="total"><a id="total-archives" href="/vcb/archives"><span class="total-title">Archives Total:</span><span class="total-number">12</span></a><div id="total-tags"><span class="total-title">Tags:</span><span class="total-number">13</span></div><div id="total-categories"><span class="total-title">Categories:</span><span class="total-number">1</span></div></section></div><div id="aside-block"><h1>INDEX</h1><div id="post-index"><ol class="toc"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%90%AF%E7%94%A8%E5%A1%AB%E5%9D%91"><span class="toc-number">1.</span> <span class="toc-text">启用填坑</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#root%E7%94%A8%E6%88%B7%E6%97%A0%E6%B3%95ssh%E8%BF%9E%E6%8E%A5%E6%9C%8D%E5%8A%A1%E5%99%A8"><span class="toc-number">1.1.</span> <span class="toc-text">root用户无法ssh连接服务器</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%BD%91%E5%8D%A1%E9%85%8D%E7%BD%AE"><span class="toc-number">1.2.</span> <span class="toc-text">网卡配置</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BE%BF%E7%AD%BE"><span class="toc-number">2.</span> <span class="toc-text">便签</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%AE%89%E8%A3%85%E5%AE%9D%E5%A1%94"><span class="toc-number">2.1.</span> <span class="toc-text">安装宝塔</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#mysql"><span class="toc-number">2.2.</span> <span class="toc-text">mysql</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#Nginx"><span class="toc-number">2.3.</span> <span class="toc-text">Nginx</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%85%B6%E4%BB%96"><span class="toc-number">3.</span> <span class="toc-text">其他</span></a></li></ol></div></div><footer><nobr><span class="text-title">©</span><span class="text-content">1970 to 2020</span></nobr><wbr><nobr><span class="text-title">ICP</span><span class="text-content">——备案号——</span></nobr><wbr><wbr><nobr>published with&nbsp;<a target="_blank" rel="noopener" href="http://hexo.io">Hexo&nbsp;</a></nobr><wbr><nobr>Theme&nbsp;<a target="_blank" rel="noopener" href="https://github.com/Yue-plus/hexo-theme-arknights">Arknight&nbsp;</a></nobr><wbr><nobr>by&nbsp;<a target="_blank" rel="noopener" href="https://github.com/Yue-plus">Yue_plus</a></nobr></footer></aside></main><canvas id="canvas-dust"></canvas><script src="/vcb/js/arknights.js"></script><script src="https://cdn.bootcdn.net/ajax/libs/highlight.js/10.1.2/highlight.min.js"></script></body></html>